package cc.comac.mom.service.impl;

import java.util.List;

import cc.comac.mom.bean.EquipMaintainPlanBean;
import cc.comac.mom.bean.ResultDev;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipMaintainPlanEntityService;
import cc.comac.mom.bean.EquipMaintainPlan;
import cc.comac.mom.datahandlers.entity.EquipMaintainPlanDataHandler;
import cc.comac.mom.util.ResultBean;
@RestController
@Service
public class EquipMaintainPlanServiceImpl implements EquipMaintainPlanEntityService{

	@Autowired
	private EquipMaintainPlanDataHandler equipMaintainPlanDataHandler;
	
	@Override
	public ResultBean insertMaintainPlan(@RequestBody List<EquipMaintainPlan> equipMaintainPlan) {
		ResultBean insertMaintainPlan = equipMaintainPlanDataHandler.insertMaintainPlan(equipMaintainPlan);
		return insertMaintainPlan;
	}

	@Override
	public ResultBean batchDeleteByMaintainPlanId(@RequestBody List<EquipMaintainPlan> list) {
		ResultBean batchDeleteByMaintainPlanId = equipMaintainPlanDataHandler.batchDeleteByMaintainPlanId(list);
		return batchDeleteByMaintainPlanId;
	}

	@Override
	public ResultBean updateByMaintainPlanId(@RequestBody EquipMaintainPlan equipMaintainPlan) {
		ResultBean updateByMaintainPlanId = equipMaintainPlanDataHandler.updateByMaintainPlanId(equipMaintainPlan);
		return updateByMaintainPlanId;
	}

	@Override
	public ResultBean selectBySomeFields(@RequestBody EquipMaintainPlanBean equipMaintainPlan) {
		ResultBean resultBean = new ResultBean(true);

		ResultDev selectByFields = equipMaintainPlanDataHandler.selectBySomeFields(equipMaintainPlan);
		resultBean.setObject(selectByFields);
		return resultBean;
	}

	@Override
	public ResultBean changeEnable(@RequestBody EquipMaintainPlan equipMaintainPlan) {
		ResultBean changeEnable = equipMaintainPlanDataHandler.changeEnable(equipMaintainPlan);
		return changeEnable;
	}

	@Override
	public ResultBean planSent(@RequestBody List<EquipMaintainPlan> list) {
		ResultBean planSent = equipMaintainPlanDataHandler.planSent(list);
		return planSent;
	}

	@Override
	public ResultBean selectBenchmarkByLocation(@RequestBody EquipMaintainPlan equipMaintainPlan) {
		;
		return equipMaintainPlanDataHandler.selectBenchmarkByLocation(equipMaintainPlan);
	}

}
